package cn.flant.io.udp;

public final class HandlerPolicy {
	private UnionType unionType;
	private long handlerTimeout;

	public HandlerPolicy(UnionType unionType, long handlerTimeout) {
		this.unionType = unionType;
		this.handlerTimeout = handlerTimeout;
	}

	public enum UnionType {
		UNION_ALL, UNION_BY_HOSTIP, UNION_BY_ADDRESS
	}

	public UnionType getUnionType() {
		return unionType;
	}

	public long getHandlerTimeout() {
		return handlerTimeout <= 0 ? Integer.MAX_VALUE : handlerTimeout;
	}
}
